package se.sll.itintegration.catalogue.gui.service.view.users;

import java.util.List;

import org.apache.camel.Body;
import org.apache.camel.Exchange;
import org.apache.camel.Property;

import se.sll.itintegration.catalogue.gui.data.UserView;
import se.sll.service.catalogue.common.rest.model.user.User;

/**
 *
 * @author khaleddaham
 */
public class UserViewProcessor {

    public void create(Exchange exchange) {
        exchange.setProperty("view", new UserView());
    }

    public void setUser(Exchange exchange, @Property("view") UserView view, @Body List<User> users) {
        view.setUser(users.get(0));
    }

    public void output(Exchange exchange, @Property("view") UserView view) {
        exchange.getOut().setBody(view);
    }
}
